import { _decorator, Button, Component, Node } from 'cc';
import { UIPanel } from '../../UI/Panel/UIPanel';
import { UILayer } from '../../UI/Panel/UILayer';
import { UIManager } from '../../UI/UIManager';
const { ccclass, property } = _decorator;

@ccclass('DemoPanel')
export class DemoPanel extends UIPanel {
    @property({ type: Node, displayName: "异步打开界面" })
    private btnOpenTest: Node = null;

    protected _layer: UILayer;

    public OnInit(data?: any): void {
        this.btnOpenTest.on(Button.EventType.CLICK, () => { UIManager.Instance.Open("TestBundle", "Panel/TestPanel", "测试数据"); });
        console.log(this.constructor.name + '.OnInit', data);
    }

    public OnShow(data?: any): void {
        console.log(this.constructor.name + '.OnShow', data);
    }

    public OnHide(): void {
        console.log(this.constructor.name + '.OnHide');
    }

    public OnDestroy(): void {
        console.log(this.constructor.name + '.OnDestroy');
    }
}


